/*
 * @Author: funlee
 * @Email: i@funlee.cn
 * @Date: 2018-05-13 23:38:14
 * @Description: 图片加载loading
 */
var myImage = (function() {
  var imgNode =document.createElement('img');
  document.body.appendChild(imgNode);

  return {
    setSrc: function(src) {
      imgNode.src = src
    }
  }
})()

console.log(myImage)
var proxyImage = (function() {
  var img = new Image;
  img.onload = function() {
    myImage.setSrc(this.src);
  }
  return {
    setSrc: function(src) {
      myImage.setSrc('../../assets/load.jpg')
      img.src = src
    }
  }
})()


// proxyImage.setSrc('http://img.zcool.cn/community/0381de85949053ca8012193a3339cc5.jpg')
myImage.setSrc('http://img.zcool.cn/community/0381de85949053ca8012193a3339cc5.jpg')


